from django.db import models


# Create your models here.
class UserInfo(models.Model):
    # 写表结构
    id = models.BigAutoField(primary_key=True)  # id long 主键自增
    name = models.CharField(max_length=32)  # name varchar(32)
    age = models.IntegerField()  # int
    email = models.CharField(max_length=64, null=True)  # email varchar64


class Depart(models.Model):
    title = models.CharField(max_length=32)


class XunleiListModels(models.Model):
    id = models.AutoField(primary_key=True)  # id long 主键自增
    main_link = models.TextField(null=False, blank=False)  # 链接内容
    front_name = models.TextField(null=True)  # 链接前置描述
    back_name = models.TextField(null=True)  # 链接后置描述
    time_join = models.IntegerField(default=0)  # 记录创建时间，使用整数存储时间戳
    image_hyperlink = models.TextField(null=True)  # 图片超链接，用,分割

    def __str__(self):
        return self.main_link
